package com.lyf.scm.admin.domain.remote.allocationservice;

import com.lyf.scm.admin.api.dto.BaseSkuInfoDTO;
import com.lyf.scm.admin.api.dto.SkuPriceDTO;
import com.lyf.scm.admin.api.dto.UnitRateQueryDTO;
import com.lyf.scm.admin.domain.remote.allocationservice.dto.BaseAreaInfoDTO;
import com.lyf.scm.admin.domain.remote.allocationservice.dto.SkuUnitDTO;
import com.lyf.scm.admin.domain.remote.basedata.dto.ChannelDTO;
import com.lyf.scm.admin.domain.remote.basedata.dto.StoreDTO;
import com.rome.arch.core.clientobject.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 缓存
 *
 * @author wangchlei
 * @date 2020/11/07
 */
@FeignClient(name = "scm-plan-service")
public interface RedisCacheRemote {
    @PostMapping("/api/v1/redisCache/channel")
    Response<Map<String, ChannelDTO>> getAllChannelInfo();

    @PostMapping("/api/v1/redisCache/store")
    Response<Map<String, StoreDTO>> getStoreInfoByCodes(@RequestBody List<String> codes);

    @PostMapping("/api/v1/redisCache/price")
    Response<Map<String, BigDecimal>> getSkuAveragePrice(@RequestBody List<SkuPriceDTO> skuPriceDTOs);

    @PostMapping("/api/v1/redisCache/sku")
    Response<Map<String, BaseSkuInfoDTO>> getCategoryInfoBySkuCodes(@RequestBody List<String> skuCodes);

    @PostMapping("/api/v1/redisCache/unit")
    Response<Map<String, SkuUnitDTO>> getUnitConversionRatio(@RequestBody List<UnitRateQueryDTO> unitRateQueryDTOs);

    @PostMapping("/api/v1/redisCache/areaInfo")
    Response<Map<String, BaseAreaInfoDTO>> getAreaInfo(@RequestBody List<String> codes, @RequestParam("type") Integer type);

    @PostMapping("/api/v1/redisCache/deliverWarehouse")
    Response<Map<String, StoreDTO>> getDeliverWarehouse();
}
